package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
)

func main() {
	//	song := make(map[string]interface{})
	//	song["name"] = "李白"
	//	song["timelength"] = 128
	//	song["author"] = "李荣浩"
	//	bytesData, err := json.Marshal(song)
	//	if err != nil {
	//		fmt.Println(err.Error())
	//		return
	//	}
	//	reader := bytes.NewReader(bytesData)
	reader := bytes.NewReader(nil)
	resp, err := http.Post("http://10.42.0.61:1000/ws/feign.do", "application/json", reader)
	if err != nil {
		// 处理错误 ...
		return
	}
	defer resp.Body.Close()
	//	io.Copy(os.Stdout, resp.Body)
	body, err := ioutil.ReadAll(resp.Body)
	checkError(err)
	fmt.Println(string(body))
}

func checkError(err error) {
	if err != nil {
		fmt.Fprintf(os.Stderr, "Fatal error: %s", err.Error())
	}
}
